Manages the meshes available in the component. More...
Public Member Functions | |
| ~MeshManager () | |
| Mesh * | createOrRetrieve (const nkMemory::StringView &name) |
| Mesh * | get (const nkMemory::StringView &name) const |
| Mesh * | getByIndex (unsigned int index) const |
| void | rename (const nkMemory::StringView ¤tName, const nkMemory::StringView &newName) |
| void | erase (const nkMemory::StringView &name) |
Manages the meshes available in the component.
The manager owns all memory allocated inside. External code should never delete it.
| nkGraphics::MeshManager::~MeshManager | ( | ) |
Destructor.
| Mesh* nkGraphics::MeshManager::createOrRetrieve | ( | const nkMemory::StringView & | name | ) |
Creates if unavailable, or retrieves if available, a mesh.
| name | The name of the mesh to retrieve. |
| Mesh* nkGraphics::MeshManager::get | ( | const nkMemory::StringView & | name | ) | const |
Retrieves an existing mesh.
| name | The name of the mesh to retrieve. |
| Mesh* nkGraphics::MeshManager::getByIndex | ( | unsigned int | index | ) | const |
Retrieves a mesh by index. Note that an index can be attached to different meshes as the internal memory gets updated. Mainly used to go over all meshes in one go.
| index | The index of the mesh to retrieve. |
| void nkGraphics::MeshManager::rename | ( | const nkMemory::StringView & | currentName, |
| const nkMemory::StringView & | newName | ||
| ) |
Renames a mesh, changing both its name and the way to access it through the manager.
| currentName | The name of the mesh to rename. |
| newName | The new name to assign to it. |
| void nkGraphics::MeshManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees the memory of a mesh.
| name | The name of the mesh to erase. |